package www;
import java.util.*;
public class piao {
	static int piao = 50;
	int tp = 0;

	public void xx() {
		Scanner reader = new Scanner(System.in);
		String num1 = reader.next();
		int number1 = Integer.parseInt(num1);
		tp = number1;
	}

	public void cc() {
		int[] x = new int[50];
		if (piao > 0) {
			if (tp == 1) {
				System.out.println("输入您想购买的票号：影院1：票号1~20。 影院2：票号21~35。 影院3：票号：36~50。");
				Scanner sc = new Scanner(System.in);
				String num2 = sc.next();
				int number2 = Integer.parseInt(num2);
				System.out.println("您购买的票号为" + num2);
				int i = 0;
				x[i] = number2;
				i++;
				System.out.println("按0进入退票");
				Scanner hc = new Scanner(System.in);
				String num3 = sc.next();
				int number3 = Integer.parseInt(num3);
				piao--;
				tp = number3;
				if (tp == 0) {
					System.out.println("请输入您要退的票号：");
					Scanner t = new Scanner(System.in);
					String yt = t.next();
					int m = Integer.parseInt(yt);
					for (int j = 0; j < 50; j++) {
						if (x[j] == m) {
							System.out.println("您退的票为：" + yt);
							piao++;
							break;
						}

						else {
							System.out.println("无此票。");
							break;
						}
					}
				} else {
					System.out.println("无效数字，请重启");
				}
			}
		}

		else {
			System.out.println("票已售空。");
		}
	}
}


